package net.jxtz.jxtzos.impl.auth;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.jxtz.jxtzos.entity.auth.Role;
import net.jxtz.jxtzos.entity.auth.User;
import net.jxtz.jxtzos.mapper.auth.UserMapper;
import net.jxtz.jxtzos.service.auth.UserService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(rollbackFor = Exception.class)
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public List<Role> getRolesByUserId(Long id) {
        return userMapper.getRolesByUserId(id);
    }

    private final UserMapper userMapper;

    @Autowired
    public UserServiceImpl(UserMapper userMapper){
        this.userMapper = userMapper;
    }
}
